// FiveDice Application. Chris Born, 2007

#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <UIKit/UIKit.h>
#import <UIKit/CDStructures.h>
#import <UIKit/UIWindow.h>
#import <UIKit/UIApplication.h>
#import <UIKit/UITextView.h>
#import <UIKit/UIView.h>
#import <UIKit/UIKeyboard.h>
#import <UIKit/UITransitionView.h>
#import <UIKit/UINavigationItem.h>
#import <UIKit/UINavBarButton.h>
#import <UIKit/UIHardware.h>
#import <UIKit/UINavigationBar.h>
#import <UIKit/UITransformAnimation.h>
#import <UIKit/UIAnimator.h>
#import <UIKit/UITransitionView.h>
#import <UIKit/UINavigationItem.h>
#import <UIKit/UIPushButton.h>
#import <UIKit/UITable.h>
#import <UIKit/UITableCell.h>

//#import <WebCore/WebFontCache.h>

#import <UIKit/UIPreferencesTable.h>
#import <UIKit/UIPreferencesTextTableCell.h>
#import <UIKit/UIPreferencesControlTableCell.h>
#import <UIKit/UIPreferencesTableCell.h>

@interface FiveDiceController : UIApplication {

	UIWindow 			*_mainWindow;
	UIView				*_mainView;
	UIView				*_scoreCardView;
	//UIPreferencesTable	*_scoreCardTable;
	NSBundle 			*_bundle;
	struct CGRect 		_contentRect;
	int					_animCount;
	CGColorSpaceRef 	_colorSpace;
	NSArray				*_diceImages;
	NSMutableArray		*_diceButtons;
	NSMutableArray		*_diceValues;
	NSDictionary		*_dice;
	NSTimer 			*_animTimer;
	UINavigationBar		*navBar;	
	
	UIPushButton	*firstButton;
	UIPushButton	*secondButton;
	UIPushButton	*thirdButton;
	UIPushButton	*fourthButton;
	UIPushButton	*fithButton;
	
	UITable				*_scoreCardTable;
	NSMutableArray		*_scoreCardCells;
	
	UIPreferencesTextTableCell	*acesCell;
	UIPreferencesTextTableCell	*twosCell;
	UIPreferencesTextTableCell	*threesCell;
	UIPreferencesTextTableCell	*foursCell;
	UIPreferencesTextTableCell	*fivesCell;
	UIPreferencesTextTableCell	*sixesCell;

	
}
#define MAXVALUE 5

- (void)setupNavbar;
- (void)setupBottomBar;
- (int)randomDie;
- (void)draw5Dice;
- (void)updateDice;
- (void)rollDice;
- (void)animateButtonImages:(NSTimer *)aTimer;
- (UIPushButton *)diceButtonWithValue:(int)val position:(int)pos;
- (NSMutableArray *)diceImages;
- (UIImage *)dieImageWithValue:(int)val downImage:(BOOL)down;

- (void)setupInterface;

- (UIWindow *)mainWindow;
- (void)setMainWindow:(UIWindow *)newMainWindow;

- (struct CGRect)rectForDiePosition:(int)pos;

@end